<template>
  <div>
    <!-- $event 固定写法，事件对象 -->
    <a href="http://baidu.com" @click="fn($event)">去百度</a>
    <!-- 未传实参，直接形参获取 -->
    <a href="http://baidu.com" @click="fn">去百度</a>
  </div>
</template>

<script>
export default {
  name: "BQ",
  components: {},
  props: {},
  data() {
    return {
      test: 1,
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    add() {
      this.test++;
    },
    add1(num) {
      this.test += num;
    },
    fn(e) {
      console.log(e);
      e.preventDefault();
    },
  },
};
</script>

<style scoped></style>
